package com.itkaien.controller;

import com.github.pagehelper.PageInfo;
import com.itkaien.dto.GoodLedgetDto;
import com.itkaien.pojo.Ledger;
import com.itkaien.service.LedgerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ledger")
public class LedgerController {

//    商品入库流水查询
//    查询条件包含以下4种:
//            1.商品名称
//            2.商品入库日期在指定入库日期之后为依据进行查询。
//            3. 查询页
//            4.页面数据量

    @Autowired
    private LedgerService ledgerService;

    @GetMapping("page")
    public PageInfo Ledgerpagegetall(Integer goodsId, Integer start, Integer pageSize) {
        int page = 0;
        page = start - 1;
        PageInfo<GoodLedgetDto> goodLedgetDtoPageInfo = ledgerService.getpageAllledger(goodsId, page, pageSize);
        return goodLedgetDtoPageInfo;
    }
}
